package com.csun.cmny.provider.dto;

import com.csun.cmny.provider.validator.OmcFoodValidator;
import lombok.Data;
import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.validator.constraints.Range;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

@Data
public class OmcFoodDto implements Serializable {
    /**
     * 食物id
     */
    private Long id;

    /**
     * 组织Id
     */
    @Range(min=1, max=999999999, message="{Food.jigou.range.error}", groups = {OmcFoodValidator.class})//这里这个范围需要更改11位
    private Long groupId;

    /**
     * 版本号
     */
    private Integer version;

    /**
     * 食物名称
     */
    @NotEmpty(message = "{Food.name.notnull}", groups = {OmcFoodValidator.class})
    @Size(min = 1, max = 32, message = "{Food.name.name.length.range}", groups = {OmcFoodValidator.class})
    private String foodName;

    /**
     * 食物类型 1 面食 2 主食 3 汤 4 其他
     */
    @NotNull(message = "{Food.type.notnull}", groups = {OmcFoodValidator.class})
    @Range(min=1, max=4, message="{Food.type.range.error}", groups = {OmcFoodValidator.class})
    private Integer foodType;

    /**
     * 食物价格
     */
    @Range(min=(long) 0.00, max=(long) 99999999.99, message="{Food.jiage.range.error}", groups = {OmcFoodValidator.class})
    private Float price;

    /**
     * 食物图片
     */
    @Size(min = 1, max = 256, message = "{Food.photo.url.range}", groups = {OmcFoodValidator.class})
    private String picture;

    /**
     * 创建人
     */
    private String creator;

    /**
     * 创建人ID
     */
    private Long creatorId;

    /**
     * 创建时间
     */
    private Date createdTime;

    /**
     * 最近操作人
     */
    private String lastOperator;

    /**
     * 最后操作人ID
     */
    private Long lastOperatorId;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 备注
     */
    private String remark;


}